<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>file</title>
</head>
<body>
	<input type="button" name="file" id="file" value="获取文件夹">
	<div id="text"></div>
	<div id="htmlbox"></div>
</body>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
	jQuery.ajaxSetup({
		timeout:3000	
	});
	$('#file').on('click',function(){
		$.ajax({
			type:'get',
			data:{
				path:''
			},
			url:'/api/file',
		}).done(function(data){
			console.log(data);
			var mes = '';
			for(var i = 0 ; i < data.length ; i++){
				mes += data[i];
				mes += '<br>';
			}
			$('#text').html(mes)
		}).error(function(err){
			console.log(err);	
		});
		$.ajax({
			type:'post',
			data:{
				path:''
			},
			url:'/api/file/sendMail.html',
		}).done(function(data){
			console.log(data);
			$('#htmlbox').html(data)
		}).error(function(err){
			console.log(err);	
		})
	})
</script>
</html>